<template>
  <div class="Newsdetail">
    <my-header myheader="新闻详情"></my-header>
    <div class="news-detail">
      <h1 class="news-title">
        {{contnet.title}}
      </h1>
      <p class="news-info">
        <span>{{contnet.add_time | filter}}</span>
        <span>{{contnet.click}}</span>
        <span>哈哈哈</span>
      </p>
    </div>
    <div class="news-content" v-html="contnet.content"></div>
    <co-mment :detailid="cid"></co-mment>
  </div>
</template>

<script>
import MyHeader from '@/components/myheader'
import CoMment from '@/components/comment'
import {getnew} from '@/api/NewsApi'
export default {
  data () {
    return {
      cid: this.$route.params.id, // 获取当前路由id
      contnet: {} // 接受页面数据
    }
  },

  components: {
    MyHeader,
    CoMment
  },

  computed: {},

  mounted () {
    // console.log()
    getnew(this.cid)
      .then(res => {
        // console.log(res)
        this.contnet = res.message[0]
      })
  },

  methods: {}
}

</script>
<style lang='scss' scoped>
.news-content{
  padding-top: 10px;
}
.news-detail {
  .news-title {
    font-size: 14px;
    font-weight: bold;
  }
  .news-info {
    font-size: 12px;
    color: #26a2ff;
    display: flex;
    justify-content: space-between;
  }
  .news-content {
    font-size: 12px;
  }
}
</style>
